home *** CD-ROM | disk | FTP | other *** search
- Path: hermes.oc.com!usenet
- From: adrianb@ug.eds.com (Adrian Brown)
- Newsgroups: comp.lang.c++
- Subject: Placement-new with virtual function problem on HP
- Date: 7 Feb 1996 16:11:02 GMT
- Organization: EDS Unigraphics, Cambridge, England
- Message-ID: <4faium$2c6@hermes.oc.com>
- NNTP-Posting-Host: boisdarc.etsu.edu
- X-Newsreader: knews 0.9.3
-
- Is the following valid C++:
-
- -------------------------------------------------------------
- #include <stddef.h>
-
- class test
- {
- public:
-
- virtual void between_the_ears();
-
- private:
-
- static void *operator new(size_t size, int pool_id);
- static void operator delete(void *memory, size_t size);
- };
- -------------------------------------------------------------
-
- On Solaris and SGI it compiles without errors or warnings.
-
- However, using the HP C++ compiler I get the following error:
-
- CC: "test1.cpp", line 4: error: argument 2 of type int expected for
- test::operator new() (1266)
-
- There was no additional documentation (that I could find) on error 1266.
- In case it makes any different it is an HP 9000/710 running HP-UX 9.05
- and the compile command is as follows:
-
- /usr/bin/CC -Aa +Z +p +w -c test1.cpp
-
- Oddly enough, if I comment out the virtual function, it compiles
- without error. Similarly if I use the non-placement form of the
- new operator:
- static void *operator new(size_t size);
- it also compiles without error.
-
- Is this me, or is it the compiler?
-
- Thanks
- AdrianB
- --
-
- ==================================================================
- Adrian Brown (Assemblies Development, Shape Data, EDS Unigraphics)
-
- Email: adrianb@ug.eds.com
- Phone: +44 (1223) 371601
-
-